<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- Foundation -->
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="css/foundation.css" />
<link rel="stylesheet" href="css/normalize.css" />
<script src="js/vendor/custom.modernizr.js"></script>
<title>Arbitres</title>
</head>
<body class="antialiased">
	<jsp:include page="/administration/inc_testLogin.jsp"></jsp:include>
	<jsp:include page="/inc_menu.jsp"></jsp:include>
	<div style="margin-top: 60px; margin-left: auto; margin-right: auto; width: 60%;">
		<a href="administration?action=editionArbitre" class="button small" style="width: 200px;">Ajouter un arbitre</a>
		<table style="width: 100%;">
			<thead>
				<tr>
					<th width="40"></th>
					<th width="40"></th>
					<th>Nom</th>
					<th>Prénom</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach var="arbitre" items="${arbitres }">
					<tr>
	 					<td><a href="administration?action=editionArbitre&id=${arbitre.getIdPersonne()}"><img src="img/edit32.png" title="Editer l'arbitre" /></a></td>
						<td><img src="img/trash32.png" title="Supprimer l'arbitre" onclick="deleteArbitre(${arbitre.getIdPersonne()})" /></td>
						<td>${arbitre.getNom() }</td>
						<td>${arbitre.getPrenom() }</td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>
	<script>
		document.write('<script src='
				+ ('__proto__' in {} ? 'js/vendor/zepto'
						: 'js/vendor/jquery') + '.js><\/script>');
	</script>
	<script src="js/foundation.min.js"></script>
	<script src="js/foundation/foundation.section.js"></script>
	<script>
		$(document).foundation();
	</script>
<script type="text/javascript">
	function deleteArbitre(idArbitre) {
		if (confirm('Etes-vous sûr de vouloir supprimer cet arbitre ?')) {
			window.location = "administration?action=suppressionArbitre&id=" + idArbitre;
	       } else {
	           return false;
	       }
	}
</script>
</body>
</html>